# plugs/login.html
#
#

from gozerlib.commands import cmnds

from google.appengine.api import users as gusers 

def handle_login(bot, event):

    if event.type == 'web':
       url = gusers.create_login_url('/')
       event._raw('WEB - %s -  <a href="%s">login</a> at google' % (event.userhost, url))
    elif event.type == "wave":
       url = gusers.create_login_url(event.url)
       event._raw('WAVE - %s - please login at google: %s' % (event.userhost, url))
    else:
       url = gusers.create_login_url('/')
       event._raw('XMPP - %s - please login at google: "%s"' % (event.userhost, url))

cmnds.add('login', handle_login, ['USER', ])
    